{extend name="base" /}

{block name="mainbody"}
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        账号管理
        <small>订餐系统后台管理</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li class="active">账号管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">

      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">员工账号信息表</h3>

              <div class="box-tools">
                <div class="input-group input-group-sm" style="width: 150px;">
                  <input type="text" name="table_search" class="form-control pull-right" placeholder="Search">

                  <div class="input-group-btn">
                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                  </div>
                </div>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover">
                <tr>
                  <th>序号</th>
                  <th>账号</th>
                  <th>昵称</th>
                  <th>当前状态</th>
                  <th>添加时间</th>
                  <th>修改时间</th>
                  <th width="200">操作</th>
                </tr>
                {foreach $userlist as $k=>$v}
                <tr>
                  <td>{$k+1}</td>
                  <td>{$v.username}</td>
                  <td>{$v.nickname}</td>
                  <td>
                    {switch v.status}
                        {case 1}<span class="label label-success">正常</span>{/case}
                        {case 2}<span class="label label-danger">禁用</span>{/case}
                        {case 6}<span class="label label-success">管理员</span>{/case}
                        {case 9}<span class="label label-danger">已删除</span>{/case}
                        {default /}<span class="label label-danger">未知</span>
                    {/switch}
                  </td>
                  <td>{$v.create_at|date='Y-m-d H:i'}</td>
                  <td>{$v.update_at|date='Y-m-d H:i'}</td>
                  <td>
                    <button type="button" class="btn btn-success btn-xs">
                      <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑</button>
                    <button type="button" onclick="doDelete('/admin/user/{$v.id}')" class="btn btn-danger btn-xs">
                      <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 删除</button>
                    <button type="button" class="btn btn-warning btn-xs">
                      <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 所属店铺</button>
                  </td>
                </tr>
                {/foreach}
              </table>
            </div>
            <!-- /.box-body -->
            <div class="box-footer clearfix">
              <a role="button" href="{:url('user/create')}" class="btn btn-primary">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 添加会员</a>
              {$page|raw}
            </div>
          </div>
          <!-- /.box -->
        </div>
      </div>

    </section>
    <!-- /.content -->
{/block}